<template>
  <el-dialog v-model="visible" title="核销明细">
    <el-table
      :data="tableData"
      stripe
      
      border
    >
      <el-table-column type="index" label="序号" width="55" />
      <el-table-column prop="name" label="标签条编码" />
      <el-table-column prop="address" label="客户积分" />
      <el-table-column prop="address" label="业务员积分" />
    </el-table>

    <el-pagination
      background
      class="mt-4"
      :total="total"
      :page-size="queryData.page"
      :page-sizes="[10, 20, 50, 100]"
      layout="total, prev, pager, next"
      @current-change="handleCurrentChange"
      @size-change="handleSizeChange"
    />

    <template #footer>
      <div class="dialog-footer">
        <el-button type="primary" @click="submitForm"> 确定 </el-button>
        <el-button @click="onCancel">取消</el-button>
      </div>
    </template>
  </el-dialog>
</template>
<script setup>
import { ref } from "vue";
import { ElMessage, ElMessageBox } from "element-plus";

const props = defineProps({
  typeName: { type: String, default: "新增" },
});
const visible = ref(false);
const tableData = [
  {
    date: "2016-05-04",
    name: "Aleyna Kutzner",
    address: "Lohrbergstr. 86c, Süd Lilli, Saarland",
  },
  {
    date: "2016-05-03",
    name: "Helen Jacobi",
    address: "760 A Street, South Frankfield, Illinois",
  },
  {
    date: "2016-05-02",
    name: "Brandon Deckert",
    address: "Arnold-Ohletz-Str. 41a, Alt Malinascheid, Thüringen",
  },
  {
    date: "2016-05-01",
    name: "Margie Smith",
    address: "23618 Windsor Drive, West Ricardoview, Idaho",
  },
];
const form = ref();
const total = 10;
const queryData = ref({ page: 1 });

const handleCurrentChange = (val) => {
  queryData.value.page = val;
};
const handleSizeChange = (val) => {
  queryData.value.page = val;
};

const submitForm = () => {
  console.log("error submit!");
  visible.value = false;
};

const onCancel = () => {
  visible.value = false;
};
const openDialog = (row) => {
  visible.value = true;
  form.value = row || {};
};

defineExpose({
  openDialog,
});
</script>
